# coding=utf-8
from kd_server.settings import BASE_DIR

TASK_CONFIG = dict(
    AppSettingConf=dict(
        AppName="xiaojun",
        SparkMaster="local[*]"
    ),
    DataSourceInputConf=dict(
        DataSourceType="textFile",
        # 后期这个字段可以支持excel文件读取支持
        DataSourceFileType="csv",
        DataSourceLocation= BASE_DIR + "/data_files/user_record.csv",
        DataSourceDelimiter=",",
        #uri目前暂时只用于mongodb的实现
        DataSourceDBUri = "",
        # 对于通用性数据库
        DataSourceDBType = 'mysql',
        DataSourceHost="127.0.0.1",
        DataSourcePort=3306,
        DataSourceUser="root",
        DataSourcePwd='',
        DataSourceDBName="",
        DataSourceDBTable="",
        DataSourceDBFds=[],
        DataSourceLimitCount=0
    ),
    MillConf=dict(
        ZHAble=False,
        AllowNumber=False,
        LimitCount=2,
        FastStopWords=""
    ),
    TransformConf=dict(
        TransformType="CountVector",
        TransformTypeList=['CountVector',"HashingTF"],
        CountVector=dict(
            InputCol="words",
            OutPutCol="feature",
        ),
        HashingTF=dict(
            InputCol="words",
            OutPutCol="feature",
        ),
        InputCol="words",
        OutPutCol="feature",
    ),
    MLConf=dict(
        MLType="LDA",
        LDA=dict(
            k=3,
            maxItNum=20,
            optimizer="em",
            describeTopics=10,
        ),
        TF_IDF=dict(
            minDoc=2,
            inputCol="features",
            outputCol="idf"
        ),
        K_Means=dict(
            k=10,
            maxItNum=30,
            seed=1,
        ),
        ALS=dict(
            k=10,
            maxItNum=30,
            regParam=0.01,
            implicitPrefs=True,
            userCol="indicesSid",
            itemCol="indicesCid",
            ratingCol="rating"
        ),
        Word2Vector=dict(),
        MLParams=dict(),
    ),
    OutputConf=dict(
        OutputType="console",
        OutTextPath="",
        OutDataBaseType = "",
        OutDataBaseName="",
        OutDataBaseHost="",
        OutDataBasePort="",
        OutDataBaseTable="",
        OutDataBaseFds="",
        OutDataBaseUser="",
        OutDataBasePwd="",
        OutHDFSPath=""
    )
)
